package soft.edu.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import soft.edu.common.ServerResponse;
import soft.edu.dao.SchRecruitPageMapper;
import soft.edu.pojo.SchRecruitPage;
import soft.edu.service.SchRecruitPageService;

import java.util.List;

@Controller("schRecruitPageService")
public class SchRecruitPageServiceImpl implements SchRecruitPageService {

    @Autowired
    private SchRecruitPageMapper schRecruitPageMapper;

//    根据院校名称获取招生简章信息
    @Override
    public ServerResponse<List<SchRecruitPage>> getInfo(String year,String rec_uni_name) {
        List<SchRecruitPage> listInfo =schRecruitPageMapper.getInfo(year,rec_uni_name);
        if(listInfo.isEmpty()){
            return ServerResponse.createByErrorMessage("招生简章信息查询不到");
        }else {
            return ServerResponse.createBySuccess("招生简章信息查询成功",listInfo);
        }
    }
}
